home *** CD-ROM | disk | FTP | other *** search
/ PC Open 97 / PC Open 97 CD2.bin / Demo / FileMaker / Data1.cab / msdso_elem.xslt4 < prev    next >
Encoding:
Extensible Markup Language  |  2002-05-24  |  3.1 KB  |  81 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  3. <!--
  4. File: msdso_elem.xslt
  5.  
  6. Transforms data in an ELEMENT based MSDSO grammar 
  7. into the FMPXMLRESULT grammar, suitable for import.
  8.       
  9. ===============================================================
  10.  
  11. Copyright ┬⌐ 2002 FileMaker, Inc.
  12. All rights reserved.
  13.  
  14. Redistribution and use in source and binary forms, with or
  15. without modification, are permitted provided that the following
  16. conditions are met:
  17.  
  18. * Redistributions of source code must retain the above copyright
  19.   notice, this list of conditions and the following disclaimer.
  20.  
  21. * Redistributions in binary form must reproduce the above copyright
  22.   notice, this list of conditions and the following disclaimer in 
  23.   the documentation and/or other materials provided with the
  24.   distribution.
  25.  
  26. * Neither the name of the FileMaker, Inc. nor the names of its 
  27.   contributors may be used to endorse or promote products derived
  28.   from this software without specific prior written
  29.   permission.
  30.  
  31. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
  32. CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
  33. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  34. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
  35. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 
  36. ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
  37. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  38. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  39. BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  40. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  41. NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  42. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  43.     
  44. ===============================================================
  45. -->
  46.        
  47.     <xsl:template match="/*">
  48.         <FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
  49.             <ERRORCODE>0</ERRORCODE>
  50.             <PRODUCT BUILD="" NAME="" VERSION=""/>
  51.             <DATABASE DATEFORMAT="M/d/yyyy" LAYOUT="" NAME="" RECORDS="{count(/*/*)}" TIMEFORMAT="h:mm:ss a"/>
  52.             <METADATA>
  53.                 <xsl:for-each select="/*/*[position()=1]/*">
  54.                     <FIELD>
  55.                         <xsl:attribute name="EMPTYOK">YES</xsl:attribute>
  56.                         <xsl:attribute name="MAXREPEAT">1</xsl:attribute>
  57.                         <xsl:attribute name="NAME"><xsl:value-of select="name()"/></xsl:attribute>
  58.                         <xsl:attribute name="TYPE">TEXT</xsl:attribute>
  59.                     </FIELD>
  60.                 </xsl:for-each>
  61.             </METADATA>
  62.             <RESULTSET>
  63.                 <xsl:attribute name="FOUND"><xsl:value-of select="count(child::*)"/></xsl:attribute>
  64.                 <xsl:for-each select="child::*">
  65.                     <ROW>
  66.                         <xsl:attribute name="MODID">0</xsl:attribute>
  67.                         <xsl:attribute name="RECORDID">0</xsl:attribute>
  68.                         <xsl:for-each select="child::*">
  69.                             <COL>
  70.                                 <DATA>
  71.                                     <xsl:value-of select="."/>
  72.                                 </DATA>
  73.                             </COL>
  74.                         </xsl:for-each>
  75.                     </ROW>
  76.                 </xsl:for-each>
  77.             </RESULTSET>
  78.         </FMPXMLRESULT>
  79.     </xsl:template>
  80. </xsl:stylesheet>
  81.